﻿#pragma once

// extern int32_t (*off_10026250)();
extern char Buffer[];
extern char Str[];
extern char aBp_0[];
extern char aSt[];
extern char aSt_0[];
extern char aStst[];
extern char aNumberOfPeaksO1_CN[12];
extern char aNumberOfPeaksO2_CN[16];
extern char aNumberOfPeaksO3_CN[12];
extern char aNumberOfPeaksO_EN[29];
extern char Format[100];
extern char aNumberOfSolven_EN[37];
extern char aNoEnoughMemory_EN[17];
extern char aNoEnoughMemory_CN[12];
extern char aNumberOfTangen_EN[37];
extern char aNumberOfTangen_CN[16];
extern char aNumberOfSolven0_CN[16];
extern char aNumberOfSolven0_EN[37];
extern char aNoEnoughMemory0_EN[17];
extern char aNoEnoughMemory0_CN[12];
extern char aNumberOfTangen0_EN[37];
extern char aNumberOfTangen0_CN[16];
extern char aNumberOfPeaksO0_EN[29];
extern char aNumberOfPeaksO0_CN[12];
extern char aNumberOfPeaksO1_EN[29];
extern char aNoFindTheGoalP_EN[23];
extern char aNoFindTheGoalP_CN[16];
extern char aThePeakStartMu_EN[40];
extern char aThePeakStartMu_CN[24];
extern char aThePeakStartCa_EN[66];
extern char aThePeakStartCa_CN[40];
extern char aNoFindTheGoalP0_EN[23];
extern char aNoFindTheGoalP0_CN[16];
extern char aThePeakEndMust_EN[38];
extern char aThePeakEndMust_CN[24];
extern char aThePeakStartCa0_EN[69];
extern char aThePeakStartCa0_CN[40];
extern char aThereIsNoneOfO_EN[35];
extern char aThereIsNoneOfO_CN[20];
extern char aCanTMoveTheSpl_EN[59];
extern char aCanTMoveTheSpl_CN[40];
extern char aCanTMoveTheSpl0_EN[68];
extern char aCanTMoveTheSpl0_CN[40];
extern char aNotLocateTheGo_EN[28];
extern char aNotLocateTheGo_CN[20];
extern char aNotLocateTheGo0_EN[28];
extern char aNotLocateTheGo0_CN[20];
extern char aCanTAddASplitI_EN[45];
extern char aCanTAddASplitI_CN[28];
extern char aCanTAddASplitO_EN[67];
extern char aCanTAddASplitO_CN[36];
extern char aCanTAddASplitO0_EN[61];
extern char aCanTAddASplitO0_CN[36];
extern char aNotLocateTheGo1_EN[28];
extern char aNotLocateTheGo1_CN[20];
extern char aNotLocateTheGo2_EN[28];
extern char aNotLocateTheGo2_CN[20];
extern char aTheGoalTimeRan_EN[34];
extern char aTheGoalTimeRan_CN[28];
extern char aCanTLocateTheG_EN[34];
extern char aCanTLocateTheG_CN[20];
extern char aCanTRecogniseA_EN[53];
extern char aCanTRecogniseA_CN[40];
extern char Source[4];
extern char aThereIsNtAnyPe_EN[49];
extern char aThereIsNtAnyPe_CN[28];
extern char aThereIsNtAnyPe0_EN[61];
extern char aThereIsNtAnyPe0_CN[32];
extern char aThereIsNtAnyPe1_EN[49];
extern char aThereIsNtAnyPe1_CN[28];
extern char aThereIsOnlyOne_EN[51];
extern char aThereIsOnlyOne_CN[28];
extern char aThePeaksInside_EN[75];
extern char aThePeaksInside_CN[28];
extern char aThereIsNtAnyPe2_EN[49];
extern char aThereIsNtAnyPe2_CN[28];
extern char aCanTMakeTangen_EN[63];
extern char aCanTMakeTangen_CN[44];
extern char aThereAreSomeTa_EN[92];
extern char aThereAreSomeTa_CN[48];
extern char aThereIsNtAnyPe3_EN[49];
extern char aThereIsNtAnyPe3_CN[28];
extern char aCanTMakeFrontT_EN[68];
extern char aCanTMakeFrontT_CN[44];
extern char aThereAreSomeTa0_EN[98];
extern char aThereAreSomeTa0_CN[48];
extern char aThereIsNtAnyPe4_EN[49];
extern char aThereIsNtAnyPe4_CN[28];
extern char aThereIsNtAnyPe5_EN[49];
extern char aThereIsNtAnyPe5_CN[28];
extern char aThereIsNtAnyPe6_EN[49];
extern char aThereIsNtAnyPe6_CN[28];
extern char aThereIsNtAnyPe7_EN[49];
extern char aThereIsNtAnyPe7_CN[28];
extern char aAnalysisDll_0[13];
extern char Str2[];

extern AUTOIPARA gMakeIPara;
// extern int32_t dword_10027DC8;
// extern float flt_10027DCC;
// extern float flt_10027DD0;

extern AUTOIPARA gLearnIPara;
// extern int32_t dword_10027DD8;
// extern float flt_10027DDC;
// extern float flt_10027DE0;

extern char Destination[256];
extern int32_t gDrift;
extern int32_t gSlope;
extern int32_t gParaCalcCounter;
extern int32_t gBufHeight;
extern void (*fnDrawTickMark)(int32_t, int32_t, TICKMARK);
extern char Str1[0x400u];
// extern int32_t dword_10027F08;
#define LANG_EN 1033
#define LANG_CN 0
extern int32_t gLanguage;
extern char gTimeInfo[1024];
extern int32_t gMaxReal;
extern int32_t gMaxRedo;
extern int32_t gMaxChannels;
extern int32_t gRecursiveCounter;
extern char gResultItemName[32];
extern int32_t gStdnoSelf[16];
extern double dblFive[5];
// extern int32_t dword_10028960;
// extern int32_t dword_10028964;
// extern double dbl_10028968;
// extern __int64 qword_10028970;
// extern __int64 qword_10028978;
// extern __int64 qword_10028980;
// extern int32_t dword_10028990[1060];

// sub_10024E70
extern int32_t compareFloat(const void *f1, const void *f2);
// CompareFunction
extern int32_t CompareFunction(const void *a, const void *b);
// sub_1000367C
extern int32_t compareFistAndSecond(const void *a, const void *b);
// sub_10024EB0
int32_t compareSecondDouble(const void *dValue1, const void *dValue2);
// sub_1001E4DD
extern double calcAmtMValue(TSTDAMTListItem *item, int32_t method);
// sub_1001E450
extern double concFactorPow(LPCTSTDAMTListItem item);
// sub_1001E47F
extern double amtKPow(LPCTSTDAMTListItem item);
// sub_10003A17
extern double getFte(TDLLResultListItem *pRes);
// sub_100039DC
extern double getFts(TDLLResultListItem *pRes);
// sub_10003C0E
extern char *formatExceedError(char *Source, int32_t len);
// sub_1000901A
extern int32_t searchSucceedAll(TDLLResultListItem *pRes, int32_t maxIndex);
// sub_10009168
extern int32_t searchSucceedFrom(TDLLResultListItem *pRes, int32_t from);
// sub_100191C1
extern int32_t calcTailItemAndCheckPeak(int32_t *pRawBagBuffer, TDLLResultListItem *pRes, int32_t head, int32_t tail,
                                        float fy, float fx);
// sub_10018F0B
extern int32_t calcTailResultItem(int32_t *pRawBagBuffer, TDLLResultListItem *pRes, int32_t head, int32_t tail,
                                  float fy, float fx);
// sub_10018C5D
extern int32_t checkTrPeak(int32_t *pRawBagBuffer, TDLLResultListItem *pRes, int32_t head, int32_t tail, float trMin,
                           float trMax);
// sub_100136AD
extern double getValueY(int32_t *buffer, float xFloat);
// sub_1001814E
extern int32_t calcTypeCodeRecursively(TDLLResultListItem *pRes, int32_t tail, int32_t head, int32_t *idxArray);
// sub_10018935
extern int32_t calcTailResultItemValue(int32_t *rawbagBuffer, TDLLResultListItem *pRes, int32_t head, int32_t tail,
                                       float fts, float fte);
// sub_100185E6
extern int32_t checkPeakSlope(int32_t *pRawBagBuffer, TDLLResultListItem *pRes, int32_t head, int32_t tail,
                              float trMin, float trMax);
// sub_1000904C
extern int32_t searchSucceedTypeCodeIdx(TDLLResultListItem *pRes, int32_t idx, int32_t maxIndex);
// sub_100184EA
extern int32_t getPrevIndexNot84(TDLLResultListItem *pRes, int32_t tail, int32_t pos);
// sub_1001855B
extern int32_t getNextIndex36_115(TDLLResultListItem *pRes, int32_t tail, int32_t pos);
// sub_10002ED7
extern char sub_10002ED7(IndexBuffer1 *pBuf);
// sub_1000B1BF
extern int32_t calcTypeCodeFromBeginning(TDLLResultListItem *pRes, int32_t tail, int32_t *idxArray);
// sub_10021D78
extern int32_t calcW50etc(TDLLResultListItem *pHead, void *pHead0, int32_t *smpHead, float freq, double xMinUnitK);
// sub_10021925
extern int32_t _EvalKHeightWEx(TDLLResultListItem *pHead, int32_t *smpHead, double k, float freq, double xMinUnitK,
                               double *lpWL, double *lpWR);
// sub_1000B1E2
extern double calcHsv(TDLLResultListItem *pRes, float fts, float hs, float slope);
// sub_1000B22A
extern double calcHev(TDLLResultListItem *pRes, float fte, float he, float slope);
// sub_1000B272
extern double calcHeadHsv(TDLLResultListItem *pRes, float fts, float hs0, float slope, float vfts, float hs);
// sub_1000B2A6
extern double calcHeadHev(TDLLResultListItem *pRes, float fte, float he0, float slope, float vfte, float he);
// sub_1000A5B3
extern bool isPeakType36_83(TDLLResultListItem *pRes);
// sub_1000A5EF
extern bool isPeakType36_115(TDLLResultListItem *pRes);
// sub_1000A62B
extern int32_t isTypeCode36(TDLLResultListItem *pRes);
// sub_10020854
extern int32_t calcTrLimt(TDLLResultListItem *pHead, int32_t *smpHead, double k, double *trL, double *trR);
// unknown_libname_9
extern int32_t unknown_libname_9(int32_t *pInt);
// unknown_libname_8
extern int32_t unknown_libname_8(int32_t *pInt);
// unknown_libname_5
extern int32_t unknown_libname_5(int32_t *pInt);
// unknown_libname_6
extern int32_t unknown_libname_6(int32_t *pInt);
// unknown_libname_16
extern void *unknown_libname_16(void **pInt);
// sub_10022079
extern int32_t checkMetric(TDLLMETRIC *metric);
// sub_1002209F
extern int32_t checkMetricDeadTime(float);
// sub_100228F1
extern int32_t isRTimeInBands(double idtTime, double band, double rTime, double tLeft, double tRight);
// sub_1001FCC8
extern int32_t qryIdxFromArray(int32_t searchNo, int32_t count, int32_t *stdnoArray);
// sub_10024C3E
extern double *calcDblFiveM1(double *arrValue, double *arrWeight, int32_t amtNum, int32_t oneOrZero,
                             int32_t curveType);
// sub_1002421F
extern double *calcDblFive(double *arrValue, double *arrWeight, int32_t amtNum, int32_t oneOrZero, int32_t curveType,
                           int32_t oneOrZero2);
// sub_1002452D
extern double calcDblFourAndX(double *arrValue, double *arrWeight, int32_t amtNum, double *d4, int32_t curveType,
                              int32_t oneOrZero2);
// sub_1001E4AE
extern double pow10_istdK(TDLLMETRIC *metric);
// sub_10023E95
extern int32_t sortAreaAndWeight(double *arrValue, double *arrWeight, int32_t amtNum, int32_t oneOrZero);
// sub_1002234C
extern int32_t invalidAreaAndHeight(TDLLResultListItem *pRes, int32_t minArea, int32_t maxHeight, char flag);
// sub_10006045
extern int32_t typeCode1Without84_116(TDLLResultListItem *pRes, int32_t flag);
// sub_1000A9A4
extern int32_t typeCode2Without84_116(TDLLResultListItem *pRes, int32_t flag);
// sub_100060B2
extern int32_t appendTypeCodeChar(char *Str, TDLLResultListItem *pRes, int32_t offset);
// sub_1001090E
extern bool isPeakType36_83_115(TDLLResultListItem *pRes);
// sub_10011065
extern int32_t typeCode84BreakAt(TDLLResultListItem *pRes, int32_t num, int32_t idx);
// sub_100110D7
extern int32_t isTrHrEmpty(TDLLResultListItem *pRes);
// sub_10011136
extern int32_t typeCode116BreakAt(TDLLResultListItem *pRes, int32_t idx);
// sub_1000F8EE
extern int32_t searchIndexMaxOrMin(int32_t mode, int32_t *pRaw, float slope, int32_t time, int32_t *pHead,
                                   int32_t *pTail, int32_t *pIdx, double val0);
// sub_10012241
extern int32_t isTypeCode84_116(TDLLResultListItem *pRes);
// sub_100121FF
extern int32_t isTypeCode84(TDLLResultListItem *pRes);
// sub_100121D2
extern char setTypeCode0(TDLLResultListItem *pRes, char val);
// sub_10012220
extern int32_t isTypeCode116(TDLLResultListItem *pRes);
// sub_100135AC
extern double searchSteepPoint(int32_t *buffer, float xBegin, float xEnd, float xTo, int32_t flag);
// sub_10013705
extern double searchSteepPointReverse(int32_t *buffer, float xBegin, float xEnd, float xFrom, int32_t flag);
// sub_10013BE5
extern int32_t checkTrPeak(int32_t *pHead, int32_t *pTail, float beginTime, float endTime, TDLLResultListItem *pRes,
                           int32_t resCount, float freq);
// sub_1001357C
extern int32_t appendTypeCode0ST(TDLLResultListItem *pRes);
// sub_10013594
extern int32_t appendTypeCode0st(TDLLResultListItem *pRes);
// sub_100143EA
extern int32_t appendTypeCode0STst(TDLLResultListItem *pRes);
// sub_100151C2
extern int32_t searchPeakA(int32_t *head, int32_t *tail, float beginTime, float endTime, TDLLResultListItem *pRes,
                           int32_t num, float freq);
// sub_1001513F
extern int32_t typeCode1Break84_116Prev(TDLLResultListItem *pRes, int32_t tail, char flag);
// sub_1001517E
extern int32_t typeCode2Break84_116Next(TDLLResultListItem *pRes, int32_t num, int32_t head, char flag);
// sub_100241F3
extern int32_t compareDouble(const void *a, const void *b);
// unknown_libname_17
extern int32_t unknown_libname_17(uint32_t *_this);
// ATL::CDynamicAccessor::GetColumnCount
extern int32_t atlGetColumnCount(uint32_t *_this);
// sub_1001A040
extern double divideX10(float val);
// Concurrency::details::ContextBase::GetExecutingCollection
extern void *ccGetExecutingCollection(void *_this);
// Concurrency::details::ContextBase::SetExecutingCollection
extern void ccSetExecutingCollection(void *_this, void *val);
// sub_10019C10
extern double divideX3_10(float a, float b);
// sub_10019C40
extern double multiplyX10(float f1);
// sub_10019C60
extern double multiplyX(float f1, float f2);
// sub_10017912
extern int32_t isValidChannel(int32_t chn);
